import { NodeApi } from "@/api/NodeApi";

const state = {
  types: []
}

const mutations = {
  SET_TYPES: (state, types) => {
    state.types = types
  }
}

const actions = {
  async getTypes ({ dispatch, commit }) {
    NodeApi.Gets().then(res => {
      commit('SET_TYPES', res.Data.Groups)
    });
    // try {
    //   commit('SET_TYPES', await fetchProcessorTypes())
    // } catch (error) {
    //   console.warn(error)
    // }
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
